<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
  targetNamespace="Examples">

  <process id="callSimpleSubProcess" isExecutable="true">

    <startEvent id="theStart" />

    <sequenceFlow id="flow1" sourceRef="theStart" targetRef="taskBeforeSubProcess" />

    <userTask id="taskBeforeSubProcess" name="Task before subprocess" />

    <sequenceFlow id="flow2" sourceRef="taskBeforeSubProcess" targetRef="callSubProcess" />

    <callActivity id="callSubProcess" calledElement="simpleSubProcess" camunda:variableMappingClass="org.camunda.bpm.engine.test.bpmn.callactivity.DelegateVarMappingThrowExceptionOutput"/>
    <boundaryEvent id="catchError" attachedToRef="callSubProcess">
      <!--errorRef ommitted so boundary event will catch everything-->
      <errorEventDefinition camunda:errorCodeVariable="myErrorVariable"/>
    </boundaryEvent>
    <sequenceFlow id="boundaryFlow2" sourceRef="catchError" targetRef="taskAfterCatchInSubprocess" />
    <userTask id="taskAfterCatchInSubprocess" name="Task after boundary catch" />
    <sequenceFlow id="boundaryFlow3" sourceRef="taskAfterCatchInSubprocess" targetRef="afterBoundaryEnd" />
    <endEvent id="afterBoundaryEnd" />

    <sequenceFlow id="flow3" sourceRef="callSubProcess" targetRef="taskAfterSubProcess" />

    <userTask id="taskAfterSubProcess" name="Task after subprocess" />

    <sequenceFlow id="flow4" sourceRef="taskAfterSubProcess" targetRef="theEnd" />

    <endEvent id="theEnd" />

  </process>

</definitions>